<div class="docs-main">

    <?php if($couresItems):?>
    <table id="tablesaw" class="tablesaw table yx-table1 yx-table3 table-striped with-check"  >
        <?php if($model->order_type == 'goods') { ?>
            <thead>
            <tr class="yx-bgd2f6ec">
                <th>商品名称</th>
                <th>价格</th>
                <th>数量</th>
                <th>小计</th>
            </tr>
            </thead>
            <?php foreach ($couresItems as $i => $item) { ?>
                <tr>
                    <td><?=$item['name']?></td>
                    <td><?=$item['price']?></td>
                    <td><?=$item['nums']?></td>
                    <td><?=$item['amount']?></td>
                </tr>
            <?php } ?>
        <?php } else { ?>
            <thead>
            <tr class="yx-bgd2f6ec">
                <td>课程名称</td>
                <td>上课老师</td>
                <td>教室</td>
                <td>最满人数</td>
                <td>上课时间</td>
                <td>已上/总课次</td>
                <td>状态</td>
                <td>课程类型</td>
            </tr>
            </thead>
            <?php foreach ($couresItems as $i => $item) { ?>
                <tr>
                    <td><?=$item['coures_name']?></td>
                    <td><?=$item['teacher']?></td>
                    <td><?=$item['classroom_name']?></td>
                    <td><?=$item['max_number']?></td>
                    <td><?=$item['goodstime']?></td>
                    <td><?=$item['have_class_count'].'/'.$item['class_count']?></td>
                    <td><?=$item['status']?></td>
                    <td>技教学</td>
                </tr>
            <?php } ?>
            <?php if(!empty($artModel)) { ?>
                <tr>
                    <td colspan="3" style="text-align: left"><span class="shows" style="font-weight: bold; font-size: 20px; cursor: pointer">+</span> &nbsp;&nbsp;&nbsp;&nbsp; <?=$artModel['title']?></td>
                    <td><?=$artModel['max_count']?></td>
                    <td><?=$artModel['class_time']?></td>
                    <td><?=$artModel['have_class_count'].'/'.$artModel['class_count']?></td>
                    <td><?=$artModel['status']?></td>
                    <td>艺教学组</td>
                </tr>
                <tbody id="art-list" style="display: none">
                <?php foreach ($artModel['art_list'] as $art):?>
                    <tr>
                        <td style="text-align: right"><?=$art['coures_name']?></td>
                        <td><?=$art['teacher_name']?></td>
                        <td><?=$art['classroom_name']?></td>
                        <td><?=$artModel['max_count']?></td>
                        <td><?=$art['class_time']?></td>
                        <td><?=$art['lesson']?></td>
                        <td><?php
                               if(!empty($lesson)){
                                   if(isset($lesson[$art['arrangement_id']]['status'])){
                                       switch ($lesson[$art['arrangement_id']]['status']){
                                           case 1:
                                               echo '已上课';
                                               break;
                                           case 0:
                                               echo '未上课';
                                               break;
                                       }
                                   }
                               }else{
                                   echo '未上课';
                               }

                            ?></td>
                        <td>艺教学</td>
                    </tr>
                <?php endforeach?>
                </tbody>
            <?php } ?>
        <?php } ?>
    </table>
    <?php endif;?>
</div>
<?php
$js = <<<JS
 $(document).on('click','.shows',function(){
    $('#art-list').show();
    $(this).attr('class','nones').html('-');
  });
$(document).on('click','.nones',function(){
    $('#art-list').hide();
    $(this).attr('class','shows').html('+');
  });


JS;
$this->registerJS($js);
?>